package com.kt.delivery.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * msg:全局异常处理类
 */
@RestControllerAdvice
public class Error {

    @ExceptionHandler(Exception.class)
    public ResponseException responseException(ApiException apiException){
        ResponseException responseException = new ResponseException();
        responseException.setCode(apiException.getCode());
        responseException.setMsg(apiException.getMsg());
        return  responseException;
    }
}
